package megrez.mail.sender.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import de.neuland.pug4j.PugConfiguration;
import megrez.mail.sender.component.Pug4jStringTemplateLoader;

/**
 * Pug4j模板配置
 * 
 * @author Lucky Yang
 * @since 2.6.9
 */
@Configuration
public class Pug4jTemplateConfiguration {
    @Bean
    public PugConfiguration pugConfiguration() {
        PugConfiguration configuration = new PugConfiguration();
        configuration.setTemplateLoader(stringTemplateLoader());
        configuration.setCaching(false);
        return configuration;
    }

    @Bean
    public Pug4jStringTemplateLoader stringTemplateLoader() {
        return new Pug4jStringTemplateLoader();
    }
}
